From: Mike Lamb Date: Mon, 23 Jan 2012 08:12:10 +0000 (-0800) Subject: Handle comments in eshell-read-hosts-file (tiny change) X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~1129 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9f7422f22152defc009457d0076826f7ccaeb835;p=emacs.git Handle comments in eshell-read-hosts-file (tiny change) * lisp/eshell/esh-util.el (eshell-read-hosts-file): Skip comment lines. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d2b30226c2..0ea2acbdf90 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-01-23 Mike Lamb (tiny change) + + * eshell/esh-util.el (eshell-read-hosts-file): + Skip comment lines. (Bug#10549) + 2012-01-23 Juanma Barranquero * subr.el (display-delayed-warnings): Doc fix. diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index f111fd91230..8218e91ddc7 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -483,7 +483,7 @@ list." (insert-file-contents eshell-hosts-file) (goto-char (point-min)) (while (re-search-forward - "^\\(\\S-+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) + "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t) (if (match-string 1) (add-to-list 'hosts (match-string 1))) (if (match-string 2)